Cut commandUseWrites out the selected bytes, characters, or fields from each line of the file.GrammarCut {
-B List [-n] | -C List | -F List [-S] [-D Character]} [File ...]DescribeThe cut command cuts bytes, characters, and fields from each line of the file and writes those bytes, characters, and fields to standard output. If you do not specify a File parameter, t
Original link: http://www.pczpg.com/html/caozuoxitong/Lunix_Unix/20090807/12861.html
Cut is used for cutting columns or fields from standard input or text files. The cut text can be pasted into a text file.
Cut General format is:Cut [options] file1 file2The following options are available:-C list Specifies the number of c
Directive Name: Cut
Function Description: Split out the specified text file in accordance with the requirements of the content
Syntax format: cut-c num1-num2-f m-n filename
Common parameter Description:
-C num1-num2 shows the first m characters of each line to the nth character;
-F m-n indicates that the column m and nth columns are displayed (using tab-delimited).
Instruction Usage Example:
1. Print te
The cut command reads content from a file or standard input and intercepts specific portions of each row and sends it to standard output.
There are three kinds of interception, one is by character position, the other is by byte position, three is using a delimiter to split a line into multiple fields, and to extract the specified fields.
The Cut
Linux cut command details, cut command details
Cut is a selection command, which is to analyze a piece of data and retrieve what we want. In general, the selection information is usually analyzed for "rows", not the entire informa
The cut command is used to read content from a file or standard input, extract specific parts of each row, and send them to standard output.
There are three ways to intercept, one is by character location, the other is by byte location, the third is to use a separator to split a line into multiple fields, and extract the specified fields.
The cut
Tags: sort_wc_uniq shell tee_tr_split cutNote content:L 8.10 Shell special symbol cut command L 8.11 sort_wc_uniq command L 8.12 tee_tr_split command L 8.13 Shell special symbol Note Date:2017.8.168.10 Shell special symbol cut command
Shell script -- cut command, shell script -- cut
Directory:1.1 option description1.2 filter by field1.3 Use -- complement1.4 split by byte or character1.5 Use -- output-delimiter1.6 specify the range in cut
1.1 option description
The cut
Tags: log file file distinguishes TXT access short expression pipe character class
Shell Special Symbol Cut command
Special symbols* wildcard characters, any of any character? Any one character# comment Characters\ de-Semantic charactersC=\ $a \ $bEcho $c| Pipe characterCat 1.txt |lessCat 1.txt |moreCut intercept stringShow first 2 rowsCAT/ETC/PASSWD |head-2Cut ":" First paragraph
|tee is to redirect, the results of the pipeline before printing on the screen#sort 2.txt |uniq-c |tee-a 4.txt//tee-a is appendThe TR command is used to replace characters[[email protected] ~]# echo "Linux" |tr ' [ln] ' [ln] '//replace ln with LNLinux[[email protected] ~]# echo "linux" |tr ' ln '//or can be written like thisLinux[[email protected] ~]# echo "Linux" |tr ' [A-z] ' [A-z] '//can specify rangeLinuxSplit
25, Shell special symbol Cut command, sort_wc_uniq command, tee_tr_split command, Shell special symbol underFirst, shell special symbol Cut commandSpecial symbols*: Wildcard.?: any one character.#: Comment characters, add to command
protected] ~]# lsattr test2-------------E-test2/test1-------------E-test2/test3-------------E-test2/test4[Email protected] ~]# lsattr-d test2----I--------E-test2[Email protected] ~]# chattr-i test2/[Email protected] ~]# RM-RF test2/If you have done the same experiment with Amin before, I believe you will have the same problem. Next, Amin to explain the effects of the two special symbols "" and "| |" By doing experiments:[email protected] ~]# Touch test1 test3[[email protected] ~]# ls test2 tou
, and the number of occurrences of the row is output at the beginning of the line#sort Testfile | UNIQ-C1 Friend3 Hello2 WorldDisplays only duplicate rows, and displays the number of repetitions of the row at the beginning of the line#sort Testfile | UNIQ-DC3 Hello2 WorldShow only rows that are not duplicatesSort Testfile | Uniq-ufriend CutThe Cut command extracts text columns from a text file or text stre
8.10 Shell Special Symbol Cut command8.11 Sort_wc_uniq Command8.12 tee_tr_split Command8.13 Shell Special Symbol
Shell Special Symbols
* represents all characters for wildcards
? is a single character
is the comment character (in the configuration file or when the command is written in front of the Add # This command will not t
Tags: 8.10 shell special Symbol Cut command8.10 Shell Special Symbol Cut command
: Represents any arbitrary character? : Represents any single character#: Denotes comment characters\ denotes a de-semantic character| Represents a pipe characterThe Cut command is used to
numbern all characters, Bytes, or fields from the beginning of Nth to the end of the lineN-m all characters, Bytes, or fields from the beginning of Nth to the first m (including the first m)-m all characters, Bytes, or fields from the beginning of the 1th to the first m (including the first m)
Read from standard input when there is no file parameter, or if the file does not exist
Interpretation:
1. Get a column of characters or bytes can be used with-C,-B, etc.
2. A range can be obtained
Unix/Linux sync command, unixlinuxsync command
Write cache command -- sync
After the unix system is started with the reboot command, the system prompts an error message, and some applications cannot work normally. After carefully
The line will log back, calculate the request time-out rate, will use the Cut command, read a good article, turned.1 Describe the cut commandAs its name, cut's job is to "cut", specifically in the document is responsible for cutting the data used.Cut is a processing object with each action, and this mechanism is the sa
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.